/*
 * ThreadUnit.cpp
 *
 *  Created on: 2013-1-16
 *      Author: heqiu
 */

#include "../include/ThreadUnit.h"

ThreadUnit::ThreadUnit() {
	m_init_flag = 0;
}

ThreadUnit::~ThreadUnit() {
}

void ThreadUnit::start() {
	if (m_init_flag == 1) {
		return;
	}
	m_init_flag = 1;
	m_thread = SDL_CreateThread((int (*)(void*))FC_ThreadFunc, this);
}

int FC_ThreadFunc(void * param) {
	ThreadUnit * threadPtr = (ThreadUnit *) param;
	threadPtr->run();
}

